using System.Collections.Generic;
using AdvancedInspector;
using UnityEngine;

[AdvancedInspector(true)]
public class LightAnigilator : MonoBehaviour
{
	public class LightCach
	{
		public Light light;

		public float cachedIntensity;
	}

	[Range(0f, 1f)]
	public float multipler = 1f;

	public List<LightCach> lights = new List<LightCach>();

	[Inspect]
	public void CachLights()
	{
		Light[] array = Object.FindObjectsOfType<Light>();
		LightCach lightCach = new LightCach();
		Light[] array2 = array;
		for (int i = 0; i < array2.Length; i++)
		{
			lightCach.cachedIntensity = (lightCach.light = array2[i]).intensity;
			lights.Add(lightCach);
			lightCach = new LightCach();
		}
	}

	[Inspect]
	public void Apply()
	{
		foreach (LightCach light in lights)
		{
			light.light.intensity = light.cachedIntensity * multipler;
		}
	}

	[Inspect]
	public void ClearCach()
	{
		lights.Clear();
	}
}
